package com.qf.business.goods.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.qf.business.goods.mapper.GoodsGuigeMapper;
import com.qf.business.goods.service.GoodsGuigeService;
import com.qf.business.goods.service.GoodsGuigeValService;
import com.qf.data.goods.entity.GoodsGuige;
import com.qf.data.goods.entity.GoodsGuigeVal;
import com.qf.data.goods.vo.output.GuigeOutput;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * (GoodsGuige)表服务实现类
 *
 * @author makejava
 * @since 2022-07-05 10:20:38
 */
@Service
public class GoodsGuigeServiceImpl extends ServiceImpl<GoodsGuigeMapper, GoodsGuige> implements GoodsGuigeService {

    @Autowired
    private GoodsGuigeMapper guigeMapper;

    @Autowired
    private GoodsGuigeValService guigeValService;

    @Override
    public List<GuigeOutput> queryList() {
        return guigeMapper.queryList();
    }


    @Override
    public List<GoodsGuigeVal> queryValList(Long guigeId){
        List<GoodsGuigeVal> valsList = guigeValService.query().eq("guige_id", guigeId).list();
        return valsList;
    }

    /**
     * 根据分类id 查询出 规格列表 以及 每个规格的数据列表
     * @param fid
     * @return
     */
    @Override
    public List<GuigeOutput> queryListByFid(Long fid) {
        return guigeMapper.queryListByFid(fid);
    }
}


